home *** CD-ROM | disk | FTP | other *** search
- Path: news.central.ntua.gr!not-for-mail
- From: hnick@central.ntua.gr (Nick C. Fotis)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Disk Space Left
- Date: 2 Mar 1996 14:50:49 GMT
- Organization: National Technical University of Athens, Greece
- Message-ID: <4h9n89$2g@zeus.central.ntua.gr>
- References: <DnL5B6.62u.0.staffin.dcs.ed.ac.uk@dcs.ed.ac.uk>
- NNTP-Posting-Host: gate2-zeus.central.ntua.gr
- X-Newsreader: NN version 6.5.0 #1 (NOV)
-
- cdc@dcs.ed.ac.uk (Christopher Carr) writes:
-
- > How do you correctly calculate the available disk space
- >left on any single device. I am referring to the the fact that some
- >small files take a minimun block size.
-
- Get a lock on the device you are interested, and then use dos.library's
- Info function which will fill a struct InfoData with information for you.
- (the struct *must* be longword alligned)
- Now in the InfoData structure you will find:
- LONG id_NumBlocks;
- LONG id_NumBlocksUsed;
- LONG id_BytesPerBlock;
- So something like (id_NumBlocks - id_NumBlocksUsed) * id_BytesPerBlock
- might give you what you want....hopefully! ;-)
- Cheers,
- /Alex
-
- --
-
- +----------------------------------------------------------------------------+
- | Alkinoos Alexandros Argiropoulos A1200, '030@40, 6MB Fast |
- | Athens, Greece "AAA is not a chipset...It's my name" |
- +----------------------------------------------------------------------------+
-